<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
    var studentName="张三"
    var studentName2="李四"
    var studentGrade=100

    function Student(name,grade){
        this.studentName=name;
        this.studentGrade=grade;
        this.goSchool=function(){
            alert(this.studentName+"要去上课了")
        }
    }
    var stu1=new Student("张三",100)
    alert(stu1.studentName)
    alert(stu1.studentGrade)
    stu1.goSchool()

    var stu2=new Student("lisa",50)
    stu2.studentGrade=90
    alert(stu2.studentGrade)

    // var arr1=new Array(10,20,30)
    // alert(arr1.length)

    // function MyArray(){
    //     this.length=arguments.length
    // }
    // var arr2=new MyArray(10,20,50,20)
    // alert(arr2.length)
    </script>
</body>
</html>